{ "cells": [ { "metadata": {}, "cell_type": "markdown", "source": [ "# Chapter 1: Hypothesis Testing & Maximum Likelihood" ], "id": "15986c3a895a01a7" }, { "cell_type": "markdown", "source": [ "## Hypothesis Testing\n", "\n", "A **hypothesis** is a statement regarding a population parameter. The hypothesis test is used to make a decision, based on a sample from the population, which of the hypotheses is true; either the **Null hypothesis** or the **Alternative hypothesis**.\n", "\n", "The null hypothesis is the default assumption that there is no relationship between two measured phenomena and is denoted as $H_0$. The alternative hypothesis is the complement of the null hypothesis and is denoted as $H_1$. Let us note this in a more formal mathematical manner.\n", "\n", "Let $\\theta$ denote the hypothesis and let us partition the parameter space $\\Theta$ into two complementary sets, $\\Theta_0$ and $\\Theta_1$, such that $\\Theta_0$+$\\Theta_1$=$\\Theta$. The **hypothesis test** tests\n", "\n", "$$H_0:\\ \\theta\\in\\Theta_0\\ \\text{versus}\\ H_1:\\ \\theta\\in\\Theta_1.$$\n", "\n", "For example, $\\theta$ may characterize the shift in frequency of light due to differences in velocities of an observer and source (Doppler shift). A sceptical astronomer may be interested to see whether the Doppler shift exists or not. The null hypothesis may then be $H_0: \\theta = 0$, implying that there is no shift in frequency while the alternative hypothesis may be $H_1: \\theta \\neq 0$.\n", "\n", "Sticking with this example, if the sceptical astronomer researches this hypothesis thoroughly (with perfect equipment), they will of course find that $\\theta\\neq0$ since the Doppler effect exists. Hence, the astronomer should **reject** the Null hypothesis. Suppose the sceptical astronomer uses faulty equipment and finds $\\theta=0$, they should then (wrongfully) **retain** the Null hypothesis.\n", "\n", "This wrongful retention is one of the two errors that can be made in hypothesis testing. Them being a **type I error** and **type II error**. A type I error occurs when the Null hypothesis is rejected when in reality it is true. A type II error occurs when a Null hypothesis is accepted while in reality it is false. In the latter example the astronomer thus makes a type II error, since the Doppler effect is real and thus there *is* a shift in frequency implying that the Null hypothesis should be rejected. These errors have been summarized in the table below.\n", "\n", "